package com.first;

import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = FirstSpringBootApplication.class,
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class UrlList {
	 private MockMvc mvc;
	 @Autowired  
	 private WebApplicationContext context; 
	 
	 @Before   
	    public void setupMockMvc() throws Exception {   
		 mvc = MockMvcBuilders.webAppContextSetup(context).build();   
	    }  
}
